#ifndef VENUS_GRAPHICS_SHADEROBJECT_H
#define VENUS_GRAPHICS_SHADEROBJECT_H

#include "common/venus.h"
#include "opengl.h"

namespace venus {
enum { FILE_SOURCE, BYTE_SOURCE };
class ShaderObject {
 public:
  static int ReadSahderFile(const char *file, char **code);
  /*
   * if source is shader code string, the caller should release it
   */
  ShaderObject(int shader_type, const char *source, 
               int source_type = FILE_SOURCE);
  ~ShaderObject();
  GLuint shader_id() const { return shader_id_; }
  bool is_valid() const { return is_compiled_; }

 private:
  void CheckCompileLog();
  void PrintCompileLog();

 private:
  GLuint shader_id_;
  bool is_compiled_;
};
} // namespace venus

#endif // VENUS_GRAPHICS_SHADEROBJECT_H
